package com.itheima.day04;
/*
案例2:键盘输入求和
 */

import java.util.Scanner;

public class TestClassCase02 {
    public static void main(String[] args) {

        Scanner sc=new Scanner(System.in);
        int sum=0;

        int[] arr=new int[5];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入"+(i+1)+"个值:");
            arr[i]=sc.nextInt();


        }
        for (int i = 0; i < arr.length ; i++) {
            sum+=arr[i];
        }

        System.out.println("和为:"+sum);


    }
}
